package cn.dlc.com.base;

/**
 * @author 邓立川
 * @date 2021/3/12 20:51
 * @desc 函数嵌套时间复杂度
 */
public class Demo4 {

    public static void main(String[] args) {
        int n = 100;
        for (int i = 0; i < n; i++) {
            // method1();
            method2();
        }
    }

    private static void method1(){
        System.out.println("method1");
    }

    private static void method2(){
        int n = 100;
        for (int i = 0; i < n; i++) {
            System.out.println("method2");
        }
    }

    private static void method3(){
        int n = 100;
        method2();
        // 继续调用method2
        for (int i = 0; i < n; i++) {
            method2();
        }

        for (int i = 0; i < n; i++) { // 执行n+1次
            for (int j = 0; j < i; j++) {
                System.out.println(j);
            }
        }
    }
}
